package com.taxi.driver.module.order.ongoing;

import android.os.Bundle;
import android.support.v4.app.Fragment;

import com.taxi.driver.R;
import com.taxi.driver.common.BaseActivityWithoutIconics;
import com.taxi.driver.config.IConstants;
import com.taxi.driver.module.amap.ANavigateFragment;

/**
 * 订单行程中
 * 功能描述：
 */
public class OrderOngoingActivity extends BaseActivityWithoutIconics {

    OrderOngoingFragment mOrderOngoingFragment;
    ANavigateFragment mANavigateFragment;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_order_ongoing);
        String orderUuid = getIntent().getStringExtra(IConstants.ORDER_UUID);
        if (mOrderOngoingFragment == null)
            addFragment(R.id.order_container, OrderOngoingFragment.newInstance(orderUuid));
        if (mANavigateFragment == null)
            addFragment(R.id.map_container, ANavigateFragment.newInstance());
    }

    @Override
    public void onAttachFragment(Fragment fragment) {
        super.onAttachFragment(fragment);
        if (fragment instanceof OrderOngoingFragment) {
            mOrderOngoingFragment = (OrderOngoingFragment) fragment;
        }
        if (fragment instanceof ANavigateFragment) {
            mANavigateFragment = (ANavigateFragment) fragment;
        }
    }

    @Override
    public void onBackPressed() {

    }
}
